package com.monster.mq;

import com.aliyuncs.exceptions.ClientException;
import com.monster.utils.sms.SmsUtils;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class SmsConsumer {

    @RabbitListener(queues = "health-monster")
    public void setMessage(Map map) throws ClientException {
        String telephone = (String)map.get("telephone");
        String code = (String)map.get("code");
        SmsUtils.validUserTelephone(telephone,code);
    }

}
